<input type="hidden" value='<%= render :partial => "add_holiday" %>' id="ahfb" name="ahfb" />
<% remote_form_for [:update_branch_office, :admin, @company] do |f| %>
  <%= hidden_field_tag :branch_office_id, bo.id %>
  <%= text_field :branch_office, :name, :value => bo.name %>, <%= t(:located_at) %> <%= text_field :branch_office, :city, :value => bo.city %> 
  
  <h3><%= t(:departments) %></h3>
  <div class="branch_office_departments">
    <ul>
    <% Department.all.each do |d| %>
      <li><%= check_box_tag 'branch_office[department_ids][]', d.id, bo.departments.include?(d) %> <span><%= d.name %></span></li>
    <% end %>
    </ul>
  </div>

  <h3><%= t(:holidays) %></h3>
  <div class="branch_office_holidays">
    <ul>
    <% bo.holidays.each do |h| %>
      <li><%= render :partial => 'update_holiday', :locals => { :h => h } %></li>
    <% end %>
    </ul>
    <div id="branch_office_<%= bo.id %>_holidays">
      <%= render :partial => 'add_holiday' %>
    </div>
    <span class="more-holidays" onclick="$('branch_office_<%= bo.id %>_holidays').insert($('ahfb').value)">[+]</span>
  </div>

  <p><%= submit_tag t(:update_branch_office) %></p>
<% end %>
